/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ListaEstadisticas.java
 *
 * Created on 24/08/2011, 03:51:36 PM
 */

package proyectocatalina;

import proyectocatalina.*;
import proyectocatalina.estadisticas.*;
import javax.swing.JInternalFrame;
import proyectocatalina.estadisticas.formulariosemestre;
import proyectocatalina.tablasystem.Permisos;
import proyectocatalina.tablasystem.UsuarioSistemas;
import proyectocatalina.tablasystem.modificarusuarios;

/**
 *
 * @author principal
 */
public class ListaMantenimientoSistema extends javax.swing.JInternalFrame {

    /** Creates new form ListaEstadisticas */
    public ListaMantenimientoSistema() {
        initComponents();
        this.setClosable(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jlista = new javax.swing.JList();
        jButton1 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setClosable(true);
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);

        jlista.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Registrar nuevo usuario", "Modificar datos usuario", "Asignar Permisos al usuario", "Cambiar/Revocar Permisos del usuario", "Nuevo nivel de Permisos", "Cambiar nivel de Permiso" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jlista.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jlista.setName(""); // NOI18N
        jScrollPane1.setViewportView(jlista);

        jButton1.setText("Ver");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setText("¿Que desea hacer?");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel1))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton1)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
            Permisos permisos = new Permisos();
            UsuarioSistemas sistema = new UsuarioSistemas();
            modificarusuarios usuario = new modificarusuarios ();
            JInternalFrame[] formularios = {usuario,sistema,permisos};
            int elementoseleccionado = jlista.getSelectedIndex();
            Principal.panel.add(formularios[elementoseleccionado]);
            formularios[elementoseleccionado].show();      
       
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ListaMantenimientoSistema().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JList jlista;
    // End of variables declaration//GEN-END:variables

}
